//
//  CYDrawCashSuccessVC.m
//  CaiYun
//
//  Created by 今日信息科技 on 2017/7/14.
//  Copyright © 2017年 今日信息科技. All rights reserved.
//

#import "CYDrawCashSuccessVC.h"

@interface CYDrawCashSuccessVC ()
@property (nonatomic, strong) CYImageView *successIMG;
@property (nonatomic, strong) CYLabel *titleLBL;
@property (nonatomic, strong) CYLabel *detailTitleLBL;
@property (nonatomic, strong) CYButton *doneBtn;
@end

@implementation CYDrawCashSuccessVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.successIMG.hidden = self.titleLBL.hidden = self.detailTitleLBL.hidden = self.doneBtn.hidden = NO;
    // Do any additional setup after loading the view.
}

- (CYImageView *)successIMG{
    if (!_successIMG) {
        _successIMG = [[CYImageView alloc]initWithImageName:@"Success" size:CGSizeMake(AL(PT(100)), AL(PT(100))) isRadius:NO];
        [self.view addSubview:_successIMG];
        
        [_successIMG mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.view).with.offset(NAVIBAR_HEIGHT + STATUS_HEIGHT + AL(PT(120)));
            make.centerX.equalTo(self.view);
            make.size.mas_equalTo(_successIMG.bounds.size);
        }];
    }
    return _successIMG;
}

- (CYLabel *)titleLBL{
    if (!_titleLBL) {
        _titleLBL = [[CYLabel alloc]initWithText:@"提现申请已提交" size:AL(PT(34)) textcolor:ColorHex(0x333333)];
        [self.view addSubview:_titleLBL];
        
        [_titleLBL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_successIMG.mas_bottom).with.offset(AL(PT(32)));
            make.centerX.equalTo(_successIMG);
            make.size.mas_equalTo(_titleLBL.bounds.size);
        }];
    }
    return _titleLBL;
}

- (CYLabel *)detailTitleLBL{
    if (!_detailTitleLBL) {
        _detailTitleLBL = [[CYLabel alloc]initWithText:@"预计2个小时内到账" size:AL(PT(22)) textcolor:ColorHex(0x888888)];
        [self.view addSubview:_detailTitleLBL];
        
        [_detailTitleLBL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_titleLBL.mas_bottom).with.offset(AL(PT(17)));
            make.centerX.equalTo(_titleLBL);
            make.size.mas_equalTo(_detailTitleLBL.bounds.size);
        }];
    }
    return _detailTitleLBL;
}

- (CYButton *)doneBtn{
    if (!_doneBtn) {
        _doneBtn = [[CYButton alloc]initWithTitle:@"完成" titleColor:ColorHex(0xf4333c) backgroundColor:[UIColor whiteColor] cornerRadius:AL(5.0)];
        _doneBtn.layer.borderColor = ColorHex(0xf4333c).CGColor;
        _doneBtn.layer.borderWidth = 0.5;
        [_doneBtn addTarget:self action:@selector(actionForDoneBtn) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:_doneBtn];
        
        [_doneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(_detailTitleLBL.mas_bottom).with.offset(AL(PT(142)));
            make.centerX.equalTo(_detailTitleLBL);
            make.size.mas_equalTo(CGSizeMake(AL(PT(452)), AL(PT(84))));
        }];
    }
    return _doneBtn;
}

- (void)actionForDoneBtn{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)setupNavigationBarTintColor:(UIColor *)color{
    [super setupNavigationBarTintColor:color];
    self.navigationItem.title = @"提现";
}
/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
